package com.bank.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@ApiModel("用户更新信息")
public class UserUpdateInfoDTO implements Serializable {
    @ApiModelProperty("用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long id;

    @ApiModelProperty("用户名")
    @Size(min = 2, max = 50, message = "用户名长度必须在2-50之间")
    private String username;

    @ApiModelProperty("密码")
    @Size(min = 6, max = 100, message = "密码长度必须在6-100之间")
    private String password;

    @ApiModelProperty("姓名")
    @Size(min = 2, max = 50, message = "姓名长度必须在2-50之间")
    private String realName;

    @ApiModelProperty("身份证号")
    @Pattern(regexp = "^\\d{17}[0-9Xx]$", message = "身份证号格式不正确")
    private String idNumber;
    @ApiModelProperty("手机号")
    @Pattern(regexp = "^1[34578]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @ApiModelProperty("邮箱")
    @Email(message = "邮箱格式不正确")
    private String email;
}
